home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6811 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: escape.com!viking
  2. From: viking@escape.com (Ken Nahshon)
  3. Newsgroups: comp.lang.pascal.misc,comp.lang.c++,comp.lang.c,comp.lang.pascal.borland
  4. Subject: Re: Tough FACTORIAL math problem...
  5. Followup-To: comp.lang.pascal.misc,comp.lang.c++,comp.lang.c,comp.lang.pascal.borland
  6. Date: 19 Feb 1996 22:42:31 GMT
  7. Organization: Escape.Com Internet Access and Services
  8. Message-ID: <4gaucn$cdu@beyond.escape.com>
  9. References: <4fr8be$ass@news.iconn.net> <4fv74c$chq@gatekeeper.alcatel.no> <93bb.5.00122006@eng.cam.ac.uk> <4g063l$a3l@stc06.ctd.ornl.gov> <4g2n5u$kqj@sun001.spd.dsccc.com> <danpop.824595562@rscernix>
  10. NNTP-Posting-Host: escape.escape.com
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Who origianlly asked about this problem...?
  14. This person is obviousely a serious loser because this was one of the 
  15. qualifying round problems for the United States of America Computing 
  16. Olypiad(USACO).  The problem is EXTREMELY simple.  All that must be done 
  17. is remove all the trailing zeros after each iteration and (the way I did 
  18. it) minus 10000 from the total if the total is greater than 10000.  
  19. Another, cleaner solution is to use the modulus operator.  
  20.  
  21. ps I did this, and speak from expierience. MINE WORKS! :)
  22.